package com.yanfan.iot.domain;

import com.yanfan.common.annotation.Excel;
import com.yanfan.common.core.domain.BaseEntity;
import com.fasterxml.jackson.annotation.JsonInclude;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import org.springframework.data.annotation.Transient;

import java.util.List;

/**
 * 产品对象 iot_product
 *
 * @author kerwincui
 * @date 2021-12-16
 */
@ApiModel(value = "Product", description = "产品对象 iot_product")
@JsonInclude(JsonInclude.Include.NON_NULL)
public class Product extends BaseEntity {
    private static final long serialVersionUID = 1L;

    /**
     * 产品ID
     */
    @ApiModelProperty("产品ID")
    @Excel(name = "产品ID",prompt = "必填")
    private Long productId;



    /**
     * 产品名称
     */
    @ApiModelProperty("产品名称")
    @Excel(name = "产品名称",prompt = "必填")
    private String productName;

    /**
     * 产品分类ID
     */
    @ApiModelProperty("产品分类ID")
    @Excel(name = "产品分类ID",prompt = "必填")
    private Long categoryId;

    /**
     * 产品分类名称
     */
    @ApiModelProperty("产品分类名称")
    @Excel(name = "产品分类名称",prompt = "必填")
    private String categoryName;

    /**
     * 租户ID
     */
    @ApiModelProperty("租户ID")
    @Excel(name = "租户ID",prompt = "必填")
    private Long tenantId;

    /**
     * 租户名称
     */
    @ApiModelProperty("租户名称")
    @Excel(name = "租户名称",prompt = "必填")
    private String tenantName;

    /**
     * 是否私有产品（0-否，1-是）私有下级不能共享
     */
    @ApiModelProperty(value = "是否私有产品", notes = "（0-否，1-是）")
    @Excel(name = "是否私有产品", readConverterExp = "0=否,1=是",prompt = "0=否,1=是")
    private Integer isSys;

    /**
     * 是否启用授权码（0-否，1-是）
     */
    @ApiModelProperty(value = "是否启用授权码", notes = "（0-否,1-是）")
    @Excel(name = "是否启用授权码",  readConverterExp = "0=否,1=是",prompt = "0=否,1=是")
    private Integer isAuthorize;



    /**
     * mqtt账号
     */
    @ApiModelProperty("mqtt账号")
    @Excel(name = "mqtt账号",prompt = "不填有默认值")
    private String mqttAccount;

    /**
     * mqtt密码
     */
    @ApiModelProperty("mqtt密码")
    @Excel(name = "mqtt密码",prompt = "不填有默认值")
    private String mqttPassword;

    /**
     * 产品秘钥
     */
    @ApiModelProperty("产品秘钥")
    @Excel(name = "产品秘钥",prompt = "不填有默认值")
    private String mqttSecret;

    /*产品协议编号*/
    @ApiModelProperty("产品协议编号")
//    @Excel(name = "产品协议编号")
    private String protocolCode;

    /*产品支持的传输协议，多个的选一个即可*/
    @ApiModelProperty("产品支持的传输协议，多个的选一个即可")
//    @Excel(name = "传输协议")
    private String transport;

    /**
     * 是否自定义位置
     **/
    @ApiModelProperty("定位方式(1=ip自动定位，2=设备定位，3=自定义)")
    @Excel(name = "定位方式", readConverterExp = "1=ip自动定位，2=设备定位，3=自定义")
    private Integer locationWay;
    /**
     * 状态（1-未发布，2-已发布，不能修改）
     */
    @ApiModelProperty(value = "状态", notes = "（1-未发布，2-已发布，不能修改）")
//    @Excel(name = "状态", readConverterExp = "1=未发布，2=已发布，不能修改")
    private Integer status;
    /**
     * 设备类型（1-直连设备、2-网关子设备、3-网关设备）
     */
    @ApiModelProperty(value = "设备类型", notes = "（1-直连设备、2-网关子设备、3-网关设备、4-网关子设备）")
    @Excel(name = "设备类型", readConverterExp = "1=直连设备，2=网关设备，3=监控设备，4-网关子设备" ,prompt = "1=直连设备,2=网关设备,3=监控设备,4=网关子设备")
    private Integer deviceType;
    /**
     * 联网方式（1=-wifi、2-蜂窝(2G/3G/4G/5G)、3-以太网、4-其他）
     */
    @ApiModelProperty(value = "联网方式", notes = "（1=-wifi、2-蜂窝(2G/3G/4G/5G)、3-以太网、4-其他）")
    @Excel(name = "联网方式", readConverterExp = "1=-wifi，2=蜂窝(2G/3G/4G/5G)，3=以太网，4=其他",prompt = "1=-wifi,2=蜂窝(2G/3G/4G/5G),3=以太网,4=其他")
    private Integer networkMethod;
    /**
     * 认证方式（1-账号密码、2-证书、3-Http）
     */
    @ApiModelProperty(value = "认证方式", notes = "（1-账号密码、2-证书、3-Http）")
    @Excel(name = "认证方式", readConverterExp = "1=账号密码，2=证书，3=Http")
    private Integer vertificateMethod;
    /**
     * 图片地址
     */
    @ApiModelProperty("图片地址")
//    @Excel(name = "图片地址")
    private String imgUrl;
    /**
     * 删除标志（0代表存在 2代表删除）
     */
    @ApiModelProperty(value = "删除标志", notes = "（0代表存在 2代表删除）")
//    @Excel(name = "删除标志", readConverterExp = "0=存在，2=删除")
    private String delFlag;
    /**
     * 物模型Json
     **/
    @ApiModelProperty("物模型Json")
//    @Excel(name = "物模型Json")
    private String thingsModelsJson;
    /**
     * 采集点模板id
     */
    @ApiModelProperty("采集点模板id")
//    @Excel(name = "采集点模板id")
    private Long templateId;
    @Transient
    @ApiModelProperty("是否显示上级")
//    @Excel(name = "是否显示上级")
    private Boolean showSenior;
    @Transient
    @ApiModelProperty("机构ID")
//    @Excel(name = "机构ID")
    private Long deptId;
    @Transient
    @ApiModelProperty("是否属于本机构 1-是，0-否")
//    @Excel(name = "是否属于本机构", readConverterExp = "1=是，0=否")
    private Integer isOwner;
    @Transient
    private Boolean isAdmin;
    //    @ApiModelProperty("关联组态guId")
    private String guid;
    /**
     * 组态主键id
     */
//    @ApiModelProperty("关联组态id")
    private Long scadaId;

    /** 请求路径 */
//    @Excel(name = "请求路径")
    private String url;

    /** 请求类型 */
//    @Excel(name = "请求类型")
    private String methodType;

    /** get请求参数 */
//    @Excel(name = "get请求参数")
    private String paramsData;

    /** 请求头参数 */
//    @Excel(name = "请求头参数")
    private String headers;

    /** post、put请求参数 */
//    @Excel(name = "post、put请求参数")
    private String data;

    /** body请求参数类型 */
//    @Excel(name = "请求参数类型")
    private String contentType;

    /** 请求间隔时间 cron表达式 */
//    @Excel(name = "请求间隔时间 cron表达式")
    private String cronExpression;

    /** 参数类型 */
//    @Excel(name = "参数类型")
    private String requestType;

    /** body请求参数类型 */
//    @Excel(name = "body请求参数类型")
    private Integer contentTypeNumber;

    /** 响应数据key */
//    @Excel(name = "响应数据key")
    private String responseKey;

    private List<HttpParam> headersList;
    private List<HttpParam> paramsDataList;


    /**
     * 远程设备地址
     */
//    @Excel(name = "远程设备地址")
    private String ipAddress;

    /**
     * 设备名称
     */
//    @Excel(name = "设备名称")
    private String equipmentName;

    /**
     * SNMP v1/v2c 团体名
     */
//    @Excel(name = " SNMP v1/v2c 团体名")
    private String community;

    /**
     * 设备名称
     */
    @ApiModelProperty("设备名称")
    @Excel(name = "设备名称",prompt = "必填")
    private String deviceName;

    /**
     * 设备编号
     */
    @ApiModelProperty("设备编号")
    @Excel(name = "设备编号",prompt = "不填写自动生成")
    private String serialNumber;


    /**
     * 物模型ID
     */
    @ApiModelProperty("物模型ID")
    @Excel(name = "物模型ID",prompt = "必填")
    private String modelId;

    /**
     * 属性名称
     */
    @ApiModelProperty("属性名称")
    @Excel(name = "属性名称",prompt = "必填")
    private String properties;

    /**
     * 属性数据类型
     */
    @ApiModelProperty("属性数据类型")
    @Excel(name = "属性数据类型",prompt = "1:integer,2:decimal,3:string,4:bool,5:array,6:enum")
    private String datatype;

    @ApiModelProperty("标识符")
    @Excel(name = "标识符",prompt = "必填")
    private String identifier;

    @ApiModelProperty("模型类别")
    @Excel(name = "模型类别",prompt = "1:属性,2:功能,3:事件")
    private String type;

    @ApiModelProperty("是否图表展示")
    @Excel(name = "是否图表展示",prompt = "0:是,1:否")
    private String isChart;


    @ApiModelProperty("是否实时监测")
    @Excel(name = "是否实时监测",prompt = "0:是,1:否")
    private String IsMonitor;

    @ApiModelProperty("物模型名称")
    @Excel(name = "物模型名称",prompt = "必填")
    private String name;


    @ApiModelProperty("最大值")
    @Excel(name = "最大值",prompt = "属性必填")
    private String max;

    @ApiModelProperty("最小值")
    @Excel(name = "最小值",prompt = "属性必填")
    private String min;

    @ApiModelProperty("步长")
    @Excel(name = "步长",prompt = "属性必填")
    private String step;

    @ApiModelProperty("单位")
    @Excel(name = "单位",prompt = "属性必填")
    private String unit;

    @Excel(name = "trueText",prompt = "功能必填，例：打开开关")
    private String trueText;


    @Excel(name = "falseText",prompt = "功能必填，例：关闭开关")
    private String falseText;

    @Excel(name = "最大长度",prompt = "string类型必填")
    private String maxLength;


    @Excel(name = "枚举类型选择",prompt = "button，select")
    private String showWay;


    @Excel(name = "按钮显示文字")
    private String text;
    @Excel(name = "按钮值")
    private String value;

    public String getShowWay() {
        return showWay;
    }

    public void setShowWay(String showWay) {
        this.showWay = showWay;
    }

    public String getText() {
        return text;
    }

    public void setText(String text) {
        this.text = text;
    }

    public String getValue() {
        return value;
    }

    public void setValue(String value) {
        this.value = value;
    }

    /**
     * snmp协议OID信息
     */
    private String oidListStr;

    private String username;

    private String userpassword;

    private Integer httptype;

    private String userkey;

    private String httpurl;

    private userParmas userParmas;

    public userParmas getUserParmas() {return userParmas;}

    public void setUserParmas(userParmas userParmas) {this.userParmas = userParmas;}

    public String getHttpurl() {
        return httpurl;
    }

    public void setHttpurl(String httpurl) {this.httpurl = httpurl;}

    public String getUsername() {
        return username;
    }

    public void setUsername(String username) {this.username=username;}

    public String getUserpassword() {
        return userpassword;
    }

    public void setUserpassword(String userpassword) {this.userpassword = userpassword;}

    public Integer getHttptype() {
        return httptype;
    }

    public void setHttptype(Integer httptype) {this.httptype = httptype;}

    public String getUserkey() {
        return userkey;
    }

    public void setUserkey(String userkey) {this.userkey = userkey;}

    public String getIpAddress() {
        return ipAddress;
    }

    public void setIpAddress(String ipAddress) {
        this.ipAddress = ipAddress;
    }

    public String getEquipmentName() {
        return equipmentName;
    }

    public void setEquipmentName(String equipmentName) {
        this.equipmentName = equipmentName;
    }

    public String getCommunity() {
        return community;
    }

    public void setCommunity(String community) {
        this.community = community;
    }

    public String getOidListStr() {
        return oidListStr;
    }

    public void setOidListStr(String oidListStr) {
        this.oidListStr = oidListStr;
    }

    public List<HttpParam> getHeadersList() {
        return headersList;
    }

    public void setHeadersList(List<HttpParam> headersList) {
        this.headersList = headersList;
    }

    public List<HttpParam> getParamsDataList() {
        return paramsDataList;
    }

    public void setParamsDataList(List<HttpParam> paramsDataList) {
        this.paramsDataList = paramsDataList;
    }

    public String getUrl() {
        return url;
    }

    public void setUrl(String url) {
        this.url = url;
    }

    public String getMethodType() {
        return methodType;
    }

    public void setMethodType(String methodType) {
        this.methodType = methodType;
    }

    public String getParamsData() {
        return paramsData;
    }

    public void setParamsData(String paramsData) {
        this.paramsData = paramsData;
    }

    public String getHeaders() {
        return headers;
    }

    public void setHeaders(String headers) {
        this.headers = headers;
    }

    public String getData() {
        return data;
    }

    public void setData(String data) {
        this.data = data;
    }

    public String getContentType() {
        return contentType;
    }

    public void setContentType(String contentType) {
        this.contentType = contentType;
    }

    public String getCronExpression() {
        return cronExpression;
    }

    public void setCronExpression(String cronExpression) {
        this.cronExpression = cronExpression;
    }

    public String getRequestType() {
        return requestType;
    }

    public void setRequestType(String requestType) {
        this.requestType = requestType;
    }

    public Integer getContentTypeNumber() {
        return contentTypeNumber;
    }

    public void setContentTypeNumber(Integer contentTypeNumber) {
        this.contentTypeNumber = contentTypeNumber;
    }

    public String getResponseKey() {
        return responseKey;
    }

    public void setResponseKey(String responseKey) {
        this.responseKey = responseKey;
    }



    public String getTransport() {
        return transport;
    }

    public void setTransport(String transport) {
        this.transport = transport;
    }

    public String getProtocolCode() {
        return protocolCode;
    }

    public void setProtocolCode(String protocolCode) {
        this.protocolCode = protocolCode;
    }

    public String getMqttSecret() {
        return mqttSecret;
    }

    public void setMqttSecret(String mqttSecret) {
        this.mqttSecret = mqttSecret;
    }

    public Long getScadaId() {
        return scadaId;
    }

    public void setScadaId(Long scadaId) {
        this.scadaId = scadaId;
    }

    public String getGuid() {
        return guid;
    }

    public void setGuid(String guid) {
        this.guid = guid;
    }

    public Boolean getAdmin() {
        return isAdmin;
    }

    public void setAdmin(Boolean admin) {
        isAdmin = admin;
    }

    public Integer getIsOwner() {
        return isOwner;
    }

    public void setIsOwner(Integer isOwner) {
        this.isOwner = isOwner;
    }

    public Boolean getShowSenior() {
        return showSenior;
    }

    public void setShowSenior(Boolean showSenior) {
        this.showSenior = showSenior;
    }

    public Long getDeptId() {
        return deptId;
    }

    public void setDeptId(Long deptId) {
        this.deptId = deptId;
    }

    public Integer getLocationWay() {
        return locationWay;
    }

    public void setLocationWay(Integer locationWay) {
        this.locationWay = locationWay;
    }

    public Long getTemplateId() {
        return templateId;
    }

    public void setTemplateId(Long templateId) {
        this.templateId = templateId;
    }

    public String getThingsModelsJson() {
        return thingsModelsJson;
    }

    public void setThingsModelsJson(String thingsModelsJson) {
        this.thingsModelsJson = thingsModelsJson;
    }

    public String getImgUrl() {
        return imgUrl;
    }

    public void setImgUrl(String imgUrl) {
        this.imgUrl = imgUrl;
    }

    public Long getProductId() {
        return productId;
    }

    public void setProductId(Long productId) {
        this.productId = productId;
    }

    public String getProductName() {
        return productName;
    }

    public void setProductName(String productName) {
        this.productName = productName;
    }

    public Long getCategoryId() {
        return categoryId;
    }

    public void setCategoryId(Long categoryId) {
        this.categoryId = categoryId;
    }

    public String getCategoryName() {
        return categoryName;
    }

    public void setCategoryName(String categoryName) {
        this.categoryName = categoryName;
    }

    public Long getTenantId() {
        return tenantId;
    }

    public void setTenantId(Long tenantId) {
        this.tenantId = tenantId;
    }

    public String getTenantName() {
        return tenantName;
    }

    public void setTenantName(String tenantName) {
        this.tenantName = tenantName;
    }

    public Integer getIsSys() {
        return isSys;
    }

    public void setIsSys(Integer isSys) {
        this.isSys = isSys;
    }

    public Integer getIsAuthorize() {
        return isAuthorize;
    }

    public void setIsAuthorize(Integer isAuthorize) {
        this.isAuthorize = isAuthorize;
    }

    public String getMqttAccount() {
        return mqttAccount;
    }

    public void setMqttAccount(String mqttAccount) {
        this.mqttAccount = mqttAccount;
    }

    public String getMqttPassword() {
        return mqttPassword;
    }

    public void setMqttPassword(String mqttPassword) {
        this.mqttPassword = mqttPassword;
    }

    public Integer getStatus() {
        return status;
    }

    public void setStatus(Integer status) {
        this.status = status;
    }

    public Integer getDeviceType() {
        return deviceType;
    }

    public void setDeviceType(Integer deviceType) {
        this.deviceType = deviceType;
    }

    public Integer getNetworkMethod() {
        return networkMethod;
    }

    public void setNetworkMethod(Integer networkMethod) {
        this.networkMethod = networkMethod;
    }

    public Integer getVertificateMethod() {
        return vertificateMethod;
    }

    public void setVertificateMethod(Integer vertificateMethod) {
        this.vertificateMethod = vertificateMethod;
    }

    public String getDelFlag() {
        return delFlag;
    }

    public void setDelFlag(String delFlag) {
        this.delFlag = delFlag;
    }


    public String getDeviceName() {
        return deviceName;
    }

    public void setDeviceName(String deviceName) {
        this.deviceName = deviceName;
    }

    public String getSerialNumber() {
        return serialNumber;
    }

    public void setSerialNumber(String serialNumber) {
        this.serialNumber = serialNumber;
    }

    public String getModelId() {
        return modelId;
    }

    public void setModelId(String modelId) {
        this.modelId = modelId;
    }

    public String getProperties() {
        return properties;
    }

    public void setProperties(String properties) {
        this.properties = properties;
    }

    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }

    public String getDatatype() {
        return datatype;
    }

    public void setDatatype(String datatype) {
        this.datatype = datatype;
    }

    public String getIdentifier() {
        return identifier;
    }

    public void setIdentifier(String identifier) {
        this.identifier = identifier;
    }

    public String getIsChart() {
        return isChart;
    }

    public void setIsChart(String isChart) {
        this.isChart = isChart;
    }

    public String getIsMonitor() {
        return IsMonitor;
    }

    public void setIsMonitor(String isMonitor) {
        IsMonitor = isMonitor;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getMax() {
        return max;
    }

    public void setMax(String max) {
        this.max = max;
    }

    public String getMin() {
        return min;
    }

    public void setMin(String min) {
        this.min = min;
    }

    public String getStep() {
        return step;
    }

    public void setStep(String step) {
        this.step = step;
    }

    public String getUnit() {
        return unit;
    }

    public void setUnit(String unit) {
        this.unit = unit;
    }

    public String getTrueText() {
        return trueText;
    }

    public void setTrueText(String trueText) {
        this.trueText = trueText;
    }

    public String getFalseText() {
        return falseText;
    }

    public void setFalseText(String falseText) {
        this.falseText = falseText;
    }

    @Override
    public String toString() {
        return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
                .append("productId", getProductId())
                .append("productName", getProductName())
                .append("categoryId", getCategoryId())
                .append("categoryName", getCategoryName())
                .append("tenantId", getTenantId())
                .append("tenantName", getTenantName())
                .append("isSys", getIsSys())
                .append("isAuthorize", getIsAuthorize())
                .append("status", getStatus())
                .append("deviceType", getDeviceType())
                .append("networkMethod", getNetworkMethod())
                .append("vertificateMethod", getVertificateMethod())
                .append("delFlag", getDelFlag())
                .append("createBy", getCreateBy())
                .append("createTime", getCreateTime())
                .append("updateBy", getUpdateBy())
                .append("updateTime", getUpdateTime())
                .append("remark", getRemark())
                .toString();
    }

    public String getMaxLength() {
        return maxLength;
    }

    public void setMaxLength(String maxLength) {
        this.maxLength = maxLength;
    }
}
